﻿@model CoreData.Menu
@{ 
    ViewBag.Title = "Update menu";
}
<div class="row-fluid">
    <div class="span12">
        <div class="head">
            <div class="isw-documents">
            </div>
            <h1>
                Detail</h1>
            <ul class="buttons">
                <li><a href="#" class="isw-settings"></a>
                    <ul class="dd-list" style="display: none;">
                        @if (Helper.SessionManagement.Value("pvalue").Contains("C"))
                        {
                            <li><a href="@Url.Action("AddOrUpdate", "MenuManagement")"><span class="isw-plus"></span>
                                Add new</a></li>
                        }
                    </ul>
                </li>
            </ul>
            <div class="clear">
            </div>
        </div>
        <div class="block-fluid tabs">
            <ul>
                <li><a href="#tabs-1">Content</a></li>
                <li><a href="#tabs-2">SEO Management</a></li>
            </ul>
            @using (Ajax.BeginForm("AddOrUpdate", "MenuManagement", new AjaxOptions { OnSuccess = "Success", HttpMethod = "Post" }, new { enctype = "multipart/form-data", @id = "validation" }))
            {
                <div class="warning-area">
                </div>
                <div id="tabs-1">
                    @Html.HiddenFor(model => model.ID)
                    <div class="row-form">
                        <div class="span2">
                            Name:</div>
                        <div class="span9">
                            @*  @Html.TextBoxFor(x => x.Name, new { @class = "validate[required,funcCall[ExistCategoryName[this]]]" })</div>*@
                            @Html.TextBoxFor(x => x.Name, new { @class = "validate[required]" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Image :</div>
                        <div class="span8">
                            <input id="fileupload" type="file" name="file" />
                            @if (Model != null && Model.Image != null && Model.Image != "")
                            {
                                <div id="image">
                                    <img src="@Url.Content("~/Media/Menu/" + Model.Image)" width="70px" height="70px" alt="@Model.Image" />
                                </div>
                            }
                            else
                            {
                                <div id="image">
                                </div>
                            }
                        </div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Parent</div>
                        <div class="span9">
                            @Html.DropDownListFor(x => x.ParentID, Model.ListParentExt, new { @class = "" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Position</div>
                        <div class="span9">
                            @Html.DropDownListFor(x => x.Position, Model.ListPositionExt, new { @class = "" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Link</div>
                        <div class="span9">
                            @Html.TextBoxFor(x => x.Link, new { @class = "" })</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Active :</div>
                        <div class="span9">
                            @Html.CheckBoxFor(x => x.Active)</div>
                        <div class="clear">
                        </div>
                    </div>
                </div>
                <div id="tabs-2">
                    <div class="row-form">
                        <div class="span2">
                            Meta Title :</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.MetaTitle)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Meta Keyword :</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.MetaKeyword)</div>
                        <div class="clear">
                        </div>
                    </div>
                    <div class="row-form">
                        <div class="span2">
                            Meta Description :</div>
                        <div class="span9">
                            @Html.TextAreaFor(x => x.MetaDescription)</div>
                        <div class="clear">
                        </div>
                    </div>
                </div>
               
                            if (Helper.SessionManagement.Value("pvalue").Contains("C") || Helper.SessionManagement.Value("pvalue").Contains("U"))
                            {
                <div class="row-form">
                    <div class="span2">
                    </div>
                    <div class="span9">
                        <input type="submit" class="btn btn-info span3" value="Update" /></div>
                    <div class="clear">
                    </div>
                </div>
                            }
            }
        </div>
    </div>
</div>
